#include <iostream>
#include <vector>
#include <ctime>
#include <cstring>
#include <cstdlib>

std::vector<int> p{2, 3, 5, 11, 13, 17, 19, 23, 31, 37};
bool vis[10000];

int main()
{
	std::srand(std::time(0));
	int T = 4;
	std::cout << T << "\n";
	int t = p.size();
	for (int i = 0; i < T; i++) {
		int n = rand() % t;
		int x = 233, y = rand() % 1000000 + x + 1;
		std::cout << n << ' ' << x << " " << y << "\n";
		memset(vis, 0, sizeof(vis));
		for (int i = 0 ; i < n; i++) {
			do {
				int tp = p[rand() % t];
				if(vis[tp]) continue;
				std::cout << tp << " " << rand() % tp << "\n";
				vis[tp] = true;
				break;
			} while (true);
		}
	}
}

